var ingredient = {
	'肉禽类':{
		'肉类':['脊骨','猪腿','羊腩','猪腰','猪皮','猪肚','猪肘','血','里脊','羊头肉','猪大肠','肥牛','脆骨','猪后腿肉','猪腱','田鸡','牛仔骨','羊肚','猪蹄筋','猪大骨','猪肺','猪头肉','驴肉','牛百叶','牛鞭','牛肚','牛肝','牛骨','牛骨髓','牛腱子','牛筋','牛里脊','牛脑','牛舌','牛蹄','牛蹄筋','牛腿肉','牛尾','牛心','牛杂','培根','腔骨','棒骨','大肠','后腿肉','肋排','龙骨','羊腿肉','羊肺','羊脑','羊蹄','蜗牛','羊心','羊血','羊腰子','猪胰','熊掌','猪骨头','猪舌','猪耳','猪尾巴','猪小肠','猪心','猪肘子','子排','羊蝎子','狗肉','猪肝','猪脚','香肠','猪蹄','排骨','猪小排','猪大排','猪血','火腿','羊排','羊肉','牛腩','牛肉','腊肉','五花肉','牛排','猪肉'],
		'禽类':['鸡中翅','鸡爪','鸭腿','鹅','鹅肝','整鸡','火鸡','乳鸽','鸡肝','鸭胗','鸡心','鸡杂','鸡脆骨','鸭舌','琵琶腿','鸭掌','鸭翅','三黄鸡','鸭胸','鸭心','鹌鹑','鸡肾','鸽子','柴鸡','翅尖','山鸡','鸡胸肉','鸡胗','鸭血','老母鸡','鸭架','鸭脖','鸡骨架','鸡脖','翅根','水鸭','野鸭','鸭子','猪排','皮蛋','鹌鹑蛋','鸭蛋','鸡蛋','鸭肝','鸭肉','乌鸡','鸡翅','鸡腿','鸡肉'],
		'野味':['兔肉','蛇肉','野兔','野味','鹿肉']
	},
	'水产品类':{
		'鱼类':['罗非鱼','鱼头','鲅鱼','鱼豆腐','鱼丸','黄鳝','比目鱼','鳊鱼','柴鱼','黑鱼','鲨鱼','鲮鱼','针鱼','沙丁鱼','鲻鱼','鱿鱼','三文鱼','章鱼','鲍鱼','鱼翅','甲鱼','鳗鱼','鲶鱼','鲳鱼','桂鱼','黄花鱼','青鱼','鲢鱼','金枪鱼','黄鱼','鳕鱼','墨鱼','鲈鱼','鲫鱼','带鱼','鲤鱼','草鱼','鱼籽','鳄鱼肉','多宝鱼','银鳕鱼','梭鱼','扒皮鱼','鱼尾','乌江鱼','三文鱼头','秋刀鱼','鱼皮','鲮鲫鱼','鲟鱼','多春鱼','凤尾鱼','白条鱼','鮰鱼','丁香鱼','黄骨鱼','鲭鱼','乌头鱼','米鱼','银鱼','泥鳅','鳎目鱼','干鱿鱼','橡皮鱼','胖头鱼','鱼泡','鲥鱼'],
		'虾类':['基围虾','河虾','北极虾','对虾','白虾','虾皮','虾肉','虾','虾米','龙虾','虾仁','小虾','皮皮虾','海虾','小龙虾'],
		'蟹类':['蟹棒','蟹肉','大闸蟹','螃蟹','海蟹'],
		'贝类':['鲜鲍','干贝','牡蛎','扇贝','香螺','蚬子肉','黄蚬子','海虹','瑶柱','鲜贝'],
		'其他水产类':['海参','裙带菜','蛤蜊','海蜇','海带','海蜇头','紫菜','螺蛳','蛏子','肉蟹','梭子蟹','牛蛙','干海带','干墨鱼','蟹子','干虾','干虾仁','膏蟹','海胆','海螺','花胶','蜇皮','螺肉','鱿鱼须','海瓜子','琼脂']
	},
	'蔬菜类':{
		'茎叶类':['空心菜','西生菜','豆芽','荠菜','苤蓝','青蒜','上海青','芥兰','韭黄','苦菊','芦蒿','白菜梗','蒜黄','紫包菜','艾草','西芹','乌塌菜','豌豆尖','紫橄榄菜','紫椰菜','萝卜苗','紫甘蓝','娃娃菜','莴苣叶','大白菜','石花菜','萝卜缨','黄心菜','香菜','芦笋','苋菜','豆苗','绿豆芽','小白菜','韭菜','生菜','茼蒿','圆白菜','油菜','芹菜','菠菜','蒜苗','白菜'],
		'根茎类':['折耳根','心里美萝卜','牛蒡','荸荠','人参','青萝卜','木薯','黑豆芽','紫菜头','笋尖','沙葛','紫甘薯','冬笋','紫薯','蒜薹','红萝卜','铁棍山药','水萝卜','萝卜','莲藕','地瓜','雪里蕻','榨菜','茭白','藕','魔芋','山药','红薯','芋头','土豆','洋葱','胡萝卜','白萝卜','竹笋','莴笋'],
		'果实类':['杭椒','干豌豆','长茄子','辣椒','五彩椒','南瓜子','生瓜','紫茄子','花菜','板栗','蚕豆','毛豆','秋葵','节瓜','四季豆','菜椒','黄花菜','扁豆','青椒','豆角','荷兰豆','茄子','豌豆','西红柿','西兰花','菜花','豇豆'],
		'瓜菜类':['佛手瓜','西葫芦','佛手','南瓜','丝瓜','苦瓜','冬瓜','黄瓜'],
		'嫩茎、叶、花':['菜心','韭菜花','莼菜','桂花','玫瑰花','菊花','百合'],
		'菌类':['姬菇','竹荪','海鲜菇','牛肝菌','干香菇','茶树菇','干松茸','干茶树菇','冬菇','发菜','花菇','鸡腿菇','红蘑','慈菇','元蘑','竹笙','杏鲍菇','蟹味菇','滑子菇','木耳','灵芝','白玉菇','白灵菇','猴头菇','银耳','黑木耳','口蘑','金针菇','平菇','蘑菇','草菇','香菇'],
		'野菜':['芥菜','梅干菜','榛蘑','金钱菇','苦苣','马兰头','冬菜','香椿','蕨菜','芽菜','橄榄菜']
	},
	'果品类':{
		'鲜果类':['橘子(桔子)','牛油果','西瓜','香蕉','石榴','青木瓜','圣女果','枣','火龙果','椰子','罗汉果','无花果','牛油果','木瓜','沙梨','樱桃','葡萄','荔枝','柿子','柚子','芒果','梨','猕猴桃','杏','李子','山楂','草莓','柠檬','菠萝','苹果'],
		'干果类':['菱角','葡萄干','瓜子仁','黑芝麻','榛子','麦芽','酸枣仁','桂圆','枸杞','莲子','杏仁','芝麻','核桃','松子','腰果','白果','花生','栗子']
	},
	'米面豆乳类':{
		'米类':['寿司米','泰国香米','粳米','黄米','红米','紫米','米线','糙米','芡实','高粱','燕麦','薏米','西米','玉米','荞麦米','小米','小麦','糯米','黑米','大米'],
		'面类':['荞麦面','荞麦面粉','黄豆面','莜麦面','红薯淀粉','油面筋','黑糯米','意面','面条','糯米粉','挂面','玉米面','藕粉','粘米粉','白面'],
		'豆类':['黄豆','青豆','绿豆','红豆','小豆','黑豆'],
		'豆制品类':['豆腐','红芸豆','豆腐干','豆皮','油豆腐','山药豆','香干','豆干','芸豆','熏干','腐竹','豆渣','日本豆腐','烤麸','内酯豆腐','嫩豆腐','百叶结'],
		'乳类':['奶酪','鲜奶油','黄油','牛奶','酸奶','起司','巧克力','奶油','淡奶油'],
		'方便食品类':['红薯粉','吐司','面包'],
		'其它':['干笋','河粉（干）','玉米糁','年糕','蕨根粉','粉皮','粉条','河粉','粉丝']
	},
	'调味品药食':{
		'调味品':['腐乳(臭)','腐乳(红)','腐乳(白)','蜂蜜','番茄汁','番茄甜辣酱','番茄沙司','番茄酱','豆豉','豆瓣辣酱','豆瓣酱','豆瓣','芥末酱','醋精','醋','粗盐','葱油','陈醋','白酱油','白胡椒','白醋','八角'],
		'药食':['蜂王浆','当归','党参','茯苓','蚕蛹','阿胶','燕窝','雪蛤']
	}
}

function searchIngredient (str) {
	var result = new Array();
	for (var o in ingredient)
		for (var i in ingredient[o]){
			var arr = ingredient[o][i];
			for (var k = arr.length - 1; k >= 0; k--) {
				if (arr[k].indexOf(str) != -1)
					result.push(arr[k]);
			};
		}
	return result;
}

function getItems(str,str2){
	var result = new Array();
	if (str == null)
		for (var o in ingredient) result.push(o);
	else if (str2 == null)
		for (var o in ingredient[str]) result.push(o);
	else
		for (var o = ingredient[str][str2].length - 1; o >= 0; o--) {
			result.push(ingredient[str][str2][o]);
		};
	return result;
}